home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / Videotoolbox 96-08-22-c.sit / VideoToolbox / (Utilities) / GrabDrivers / GrabVideoDrivers.c < prev    next >
MacBinary  |  1996-07-09  |  7.5 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: GrabVideoDrivers.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Jul 9 02:52:37 1996, modified Tue Jul 9 02:52:37 1996, creator 'CWIE', type ASCII, 6894 bytes "GrabVideoDrivers.c" , at 0x1b6e 536 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 12 47 72 61 62 56 69 | 64 65 6f 44 72 69 76 65 |..GrabVi|deoDrive|
|00000010| 72 73 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |rs.c....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 1a ee 00 | 00 02 18 ae 07 b2 35 ae |........|......5.|
|00000060| 07 b2 35 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..5.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 83 bf 00 00 |........|........|
|00000080| 2f 2a 0d 47 72 61 62 56 | 69 64 65 6f 44 72 69 76 |/*.GrabV|ideoDriv|
|00000090| 65 72 73 2e 63 0d 47 65 | 74 73 20 65 61 63 68 20 |ers.c.Ge|ts each |
|000000a0| 61 63 74 69 76 65 20 76 | 69 64 65 6f 20 64 72 69 |active v|ideo dri|
|000000b0| 76 65 72 20 61 6e 64 20 | 73 61 76 65 73 20 69 74 |ver and |saves it|
|000000c0| 20 69 6e 20 61 20 66 69 | 6c 65 20 6f 66 20 74 68 | in a fi|le of th|
|000000d0| 65 20 73 61 6d 65 20 6e | 61 6d 65 2c 20 75 73 69 |e same n|ame, usi|
|000000e0| 6e 67 20 74 68 65 0d 64 | 72 69 76 65 72 27 73 20 |ng the.d|river's |
|000000f0| 76 65 72 73 69 6f 6e 20 | 6e 75 6d 62 65 72 20 61 |version |number a|
|00000100| 73 20 61 20 72 65 73 6f | 75 72 63 65 20 69 64 2e |s a reso|urce id.|
|00000110| 20 54 68 65 73 65 20 66 | 69 6c 65 73 20 63 61 6e | These f|iles can|
|00000120| 20 6c 61 74 65 72 20 62 | 65 20 65 78 61 6d 69 6e | later b|e examin|
|00000130| 65 64 20 69 6e 0d 52 65 | 73 45 64 69 74 2c 20 75 |ed in.Re|sEdit, u|
|00000140| 73 69 6e 67 20 74 68 65 | 20 70 75 62 6c 69 63 20 |sing the| public |
|00000150| 64 6f 6d 61 69 6e 20 43 | 4f 44 45 20 65 64 69 74 |domain C|ODE edit|
|00000160| 6f 72 2e 20 59 6f 75 27 | 6c 6c 20 77 61 6e 74 20 |or. You'|ll want |
|00000170| 74 6f 20 63 6f 6e 73 75 | 6c 74 20 41 70 70 6c 65 |to consu|lt Apple|
|00000180| 27 73 0d 44 65 73 69 67 | 6e 69 6e 67 20 43 61 72 |'s.Desig|ning Car|
|00000190| 64 73 20 61 6e 64 20 44 | 72 69 76 65 72 73 2c 20 |ds and D|rivers, |
|000001a0| 33 72 64 20 45 64 2e 2c | 20 41 64 64 69 73 6f 6e |3rd Ed.,| Addison|
|000001b0| 20 57 65 73 6c 65 79 2e | 0d 0d 54 68 65 20 52 65 | Wesley.|..The Re|
|000001c0| 73 45 64 69 74 20 43 4f | 44 45 20 65 64 69 74 6f |sEdit CO|DE edito|
|000001d0| 72 20 69 73 20 61 20 70 | 75 62 6c 69 63 20 64 6f |r is a p|ublic do|
|000001e0| 6d 61 69 6e 20 66 69 6c | 65 2c 20 66 6f 72 20 75 |main fil|e, for u|
|000001f0| 73 65 20 77 69 74 68 20 | 52 65 73 45 64 69 74 2c |se with |ResEdit,|
|00000200| 0d 64 69 73 74 72 69 62 | 75 74 65 64 20 62 79 3a |.distrib|uted by:|
|00000210| 0d 49 72 61 20 4c 2e 20 | 52 75 62 65 6e 0d 41 70 |.Ira L. |Ruben.Ap|
|00000220| 70 6c 65 20 43 6f 6d 70 | 75 74 65 72 2c 20 49 6e |ple Comp|uter, In|
|00000230| 63 2e 0d 32 30 35 32 35 | 20 4d 61 72 69 61 6e 69 |c..20525| Mariani|
|00000240| 20 41 76 65 2e 2c 20 4d | 53 3a 20 33 37 2d 41 0d | Ave., M|S: 37-A.|
|00000250| 43 75 70 65 72 74 69 6e | 6f 2c 20 43 61 2e 20 39 |Cupertin|o, Ca. 9|
|00000260| 35 30 31 34 0d 49 72 61 | 40 41 70 70 6c 65 2e 43 |5014.Ira|@Apple.C|
|00000270| 6f 6d 0d 66 74 70 3a 2f | 2f 66 74 70 2e 61 70 70 |om.ftp:/|/ftp.app|
|00000280| 6c 65 2e 63 6f 6d 2f 64 | 74 73 2f 6d 61 63 2f 74 |le.com/d|ts/mac/t|
|00000290| 6f 6f 6c 73 2f 72 65 73 | 65 64 69 74 2f 0d 0d 43 |ools/res|edit/..C|
|000002a0| 6f 70 79 72 69 67 68 74 | 20 72 65 73 74 72 69 63 |opyright| restric|
|000002b0| 74 69 6f 6e 73 20 70 72 | 65 76 65 6e 74 20 75 73 |tions pr|event us|
|000002c0| 20 66 72 6f 6d 20 64 69 | 73 74 72 69 62 75 74 69 | from di|stributi|
|000002d0| 6e 67 20 76 69 64 65 6f | 20 64 72 69 76 65 72 73 |ng video| drivers|
|000002e0| 20 74 68 65 6d 73 65 6c | 76 65 73 2c 0d 62 75 74 | themsel|ves,.but|
|000002f0| 20 74 68 69 73 20 70 72 | 6f 67 72 61 6d 20 6d 61 | this pr|ogram ma|
|00000300| 6b 65 73 20 69 74 20 65 | 61 73 79 20 66 6f 72 20 |kes it e|asy for |
|00000310| 79 6f 75 20 74 6f 20 67 | 65 74 20 61 6e 20 61 63 |you to g|et an ac|
|00000320| 63 65 73 73 69 62 6c 65 | 20 63 6f 70 79 20 6f 66 |cessible| copy of|
|00000330| 20 61 6c 6c 20 74 68 65 | 0d 76 69 64 65 6f 20 64 | all the|.video d|
|00000340| 72 69 76 65 72 73 20 75 | 73 65 64 20 69 6e 20 79 |rivers u|sed in y|
|00000350| 6f 75 72 20 6f 77 6e 20 | 63 6f 6d 70 75 74 65 72 |our own |computer|
|00000360| 73 2e 0d 0d 54 68 65 20 | 70 72 69 6d 61 72 79 20 |s...The |primary |
|00000370| 75 73 65 72 73 20 6f 66 | 20 74 68 69 73 20 70 72 |users of| this pr|
|00000380| 6f 67 72 61 6d 20 77 69 | 6c 6c 20 70 72 6f 62 61 |ogram wi|ll proba|
|00000390| 62 6c 79 20 62 65 20 74 | 68 6f 73 65 20 77 68 6f |bly be t|hose who|
|000003a0| 20 77 69 73 68 20 74 6f | 20 65 6e 68 61 6e 63 65 | wish to| enhance|
|000003b0| 0d 53 65 74 45 6e 74 72 | 69 65 73 51 75 69 63 6b |.SetEntr|iesQuick|
|000003c0| 6c 79 2e 63 2e 20 49 20 | 68 6f 70 65 20 74 68 61 |ly.c. I |hope tha|
|000003d0| 74 20 70 65 6f 70 6c 65 | 20 77 69 6c 6c 20 73 68 |t people| will sh|
|000003e0| 61 72 65 20 74 68 65 20 | 66 72 75 69 74 73 20 6f |are the |fruits o|
|000003f0| 66 20 74 68 65 69 72 20 | 6c 61 62 6f 72 73 20 62 |f their |labors b|
|00000400| 79 0d 73 65 6e 64 69 6e | 67 20 6d 65 20 74 68 65 |y.sendin|g me the|
|00000410| 20 65 6e 68 61 6e 63 65 | 6d 65 6e 74 73 20 66 6f | enhance|ments fo|
|00000420| 72 20 64 69 73 74 72 69 | 62 75 74 69 6f 6e 20 61 |r distri|bution a|
|00000430| 73 20 70 61 72 74 20 6f | 66 20 74 68 65 20 56 69 |s part o|f the Vi|
|00000440| 64 65 6f 54 6f 6f 6c 62 | 6f 78 2e 0d 0d 54 68 69 |deoToolb|ox...Thi|
|00000450| 73 20 70 72 6f 67 72 61 | 6d 20 69 73 20 61 6c 73 |s progra|m is als|
|00000460| 6f 20 75 73 65 66 75 6c | 20 66 6f 72 20 63 6f 70 |o useful| for cop|
|00000470| 79 69 6e 67 20 74 68 65 | 20 4d 61 63 20 49 49 73 |ying the| Mac IIs|
|00000480| 69 20 76 69 64 65 6f 20 | 64 72 69 76 65 72 20 74 |i video |driver t|
|00000490| 6f 20 74 68 65 20 4d 61 | 63 0d 49 49 63 69 2e 20 |o the Ma|c.IIci. |
|000004a0| 53 69 6e 63 65 20 74 68 | 61 74 27 73 20 61 20 52 |Since th|at's a R|
|000004b0| 4f 4d 2d 62 61 73 65 64 | 20 64 72 69 76 65 72 20 |OM-based| driver |
|000004c0| 49 20 64 6f 6e 27 74 20 | 6b 6e 6f 77 20 61 6e 79 |I don't |know any|
|000004d0| 20 77 61 79 20 74 6f 20 | 61 75 74 6f 6d 61 74 69 | way to |automati|
|000004e0| 63 61 6c 6c 79 0d 64 65 | 74 65 72 6d 69 6e 65 20 |cally.de|termine |
|000004f0| 69 74 73 20 73 69 7a 65 | 2c 20 61 6e 64 20 69 6e |its size|, and in|
|00000500| 73 74 65 61 64 20 74 68 | 69 73 20 70 72 6f 67 72 |stead th|is progr|
|00000510| 61 6d 20 75 73 65 73 20 | 61 20 67 65 6e 65 72 6f |am uses |a genero|
|00000520| 75 73 20 67 75 65 73 73 | 2e 20 43 6f 6e 73 65 71 |us guess|. Conseq|
|00000530| 75 65 6e 74 6c 79 0d 74 | 68 65 20 72 65 73 75 6c |uently.t|he resul|
|00000540| 74 69 6e 67 20 72 65 73 | 6f 75 72 63 65 20 69 73 |ting res|ource is|
|00000550| 20 6c 61 72 67 65 72 20 | 74 68 61 6e 20 69 74 20 | larger |than it |
|00000560| 6e 65 65 64 73 20 74 6f | 20 62 65 2e 20 57 68 65 |needs to| be. Whe|
|00000570| 6e 20 79 6f 75 20 69 6e | 73 74 61 6c 6c 20 74 68 |n you in|stall th|
|00000580| 69 73 0d 72 65 73 6f 75 | 72 63 65 20 69 6e 20 74 |is.resou|rce in t|
|00000590| 68 65 20 53 79 73 74 65 | 6d 20 66 69 6c 65 20 6f |he Syste|m file o|
|000005a0| 66 20 79 6f 75 72 20 4d | 61 63 20 49 49 63 69 20 |f your M|ac IIci |
|000005b0| 74 68 65 20 65 78 63 65 | 73 73 20 73 70 61 63 65 |the exce|ss space|
|000005c0| 20 69 73 20 77 61 73 74 | 65 64 20 28 62 6f 74 68 | is wast|ed (both|
|000005d0| 20 6f 6e 0d 64 69 73 6b | 20 61 6e 64 20 69 6e 20 | on.disk| and in |
|000005e0| 6d 65 6d 6f 72 79 29 2c | 20 62 75 74 20 74 68 65 |memory),| but the|
|000005f0| 20 65 78 63 65 73 73 20 | 69 73 20 6f 6e 6c 79 20 | excess |is only |
|00000600| 61 62 6f 75 74 20 31 20 | 4b 42 2c 20 73 6f 20 69 |about 1 |KB, so i|
|00000610| 74 20 64 6f 65 73 6e 27 | 74 20 73 65 65 6d 20 77 |t doesn'|t seem w|
|00000620| 6f 72 74 68 0d 77 6f 72 | 72 79 69 6e 67 20 61 62 |orth.wor|rying ab|
|00000630| 6f 75 74 2e 0d 0d 48 49 | 53 54 4f 52 59 3a 0d 32 |out...HI|STORY:.2|
|00000640| 2f 38 39 20 64 67 70 20 | 57 72 6f 74 65 20 69 74 |/89 dgp |Wrote it|
|00000650| 20 61 73 20 22 76 69 64 | 65 6f 20 68 61 63 6b 65 | as "vid|eo hacke|
|00000660| 72 20 49 49 2e 63 22 20 | 75 73 69 6e 67 20 54 48 |r II.c" |using TH|
|00000670| 49 4e 4b 20 22 4c 69 67 | 68 74 20 53 70 65 65 64 |INK "Lig|ht Speed|
|00000680| 22 20 43 20 33 2e 0d 31 | 32 2f 33 30 2f 39 32 20 |" C 3..1|2/30/92 |
|00000690| 64 67 70 20 75 70 64 61 | 74 65 64 20 69 74 20 74 |dgp upda|ted it t|
|000006a0| 6f 20 54 48 49 4e 4b 20 | 43 20 35 20 61 6e 64 20 |o THINK |C 5 and |
|000006b0| 72 65 6e 61 6d 65 64 20 | 69 74 20 47 72 61 62 56 |renamed |it GrabV|
|000006c0| 69 64 65 6f 44 72 69 76 | 65 72 73 2e 63 0d 37 2f |ideoDriv|ers.c.7/|
|000006d0| 32 39 2f 39 34 20 64 67 | 70 20 45 6c 69 6d 69 6e |29/94 dg|p Elimin|
|000006e0| 61 74 65 64 20 75 73 65 | 20 6f 66 20 22 23 73 22 |ated use| of "#s"|
|000006f0| 20 70 72 69 6e 74 66 20 | 66 6f 72 6d 61 74 2c 20 | printf |format, |
|00000700| 73 69 6e 63 65 20 69 74 | 27 73 20 6e 6f 74 20 73 |since it|'s not s|
|00000710| 75 70 70 6f 72 74 65 64 | 20 62 79 0d 09 09 09 4d |upported| by....M|
|00000720| 65 74 72 6f 77 65 72 6b | 73 20 43 6f 64 65 57 61 |etrowerk|s CodeWa|
|00000730| 72 72 69 6f 72 20 43 2e | 0d 39 2f 35 2f 39 34 20 |rrior C.|.9/5/94 |
|00000740| 64 67 70 20 72 65 6d 6f | 76 65 64 20 61 73 73 75 |dgp remo|ved assu|
|00000750| 6d 70 74 69 6f 6e 20 69 | 6e 20 70 72 69 6e 74 66 |mption i|n printf|
|00000760| 27 73 20 74 68 61 74 20 | 69 6e 74 3d 3d 73 68 6f |'s that |int==sho|
|00000770| 72 74 2e 0d 36 2f 38 2f | 39 35 20 64 67 70 20 4d |rt..6/8/|95 dgp M|
|00000780| 61 64 65 20 73 75 72 65 | 20 74 68 61 74 20 4d 61 |ade sure| that Ma|
|00000790| 63 20 73 74 72 75 63 74 | 73 20 61 72 65 20 61 6c |c struct|s are al|
|000007a0| 77 61 79 73 20 36 38 6b | 20 61 6c 69 67 6e 65 64 |ways 68k| aligned|
|000007b0| 2e 0d 2a 2f 0d 23 69 6e | 63 6c 75 64 65 20 22 56 |..*/.#in|clude "V|
|000007c0| 69 64 65 6f 54 6f 6f 6c | 62 6f 78 2e 68 22 0d 2f |ideoTool|box.h"./|
|000007d0| 2f 23 69 6e 63 6c 75 64 | 65 20 3c 45 72 72 6f 72 |/#includ|e <Error|
|000007e0| 73 2e 68 3e 0d 2f 2f 23 | 69 6e 63 6c 75 64 65 20 |s.h>.//#|include |
|000007f0| 3c 46 69 6c 65 73 2e 68 | 3e 0d 2f 2f 23 69 6e 63 |<Files.h|>.//#inc|
|00000800| 6c 75 64 65 20 3c 52 65 | 73 6f 75 72 63 65 73 2e |lude <Re|sources.|
|00000810| 68 3e 0d 48 61 6e 64 6c | 65 20 47 65 74 44 72 69 |h>.Handl|e GetDri|
|00000820| 76 65 72 46 72 6f 6d 53 | 6c 6f 74 4d 61 6e 61 67 |verFromS|lotManag|
|00000830| 65 72 28 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |er(GDHan|dle devi|
|00000840| 63 65 29 3b 0d 0d 76 6f | 69 64 20 6d 61 69 6e 28 |ce);..vo|id main(|
|00000850| 76 6f 69 64 29 3b 0d 76 | 6f 69 64 20 43 6f 70 79 |void);.v|oid Copy|
|00000860| 44 65 76 69 63 65 44 72 | 69 76 65 72 28 47 44 48 |DeviceDr|iver(GDH|
|00000870| 61 6e 64 6c 65 20 64 65 | 76 69 63 65 29 3b 0d 76 |andle de|vice);.v|
|00000880| 6f 69 64 20 41 64 64 52 | 65 73 6f 75 72 63 65 54 |oid AddR|esourceT|
|00000890| 6f 46 69 6c 65 28 75 6e | 73 69 67 6e 65 64 20 63 |oFile(un|signed c|
|000008a0| 68 61 72 20 2a 66 69 6c | 65 6e 61 6d 65 2c 75 6e |har *fil|ename,un|
|000008b0| 73 69 67 6e 65 64 20 63 | 68 61 72 20 2a 6e 61 6d |signed c|har *nam|
|000008c0| 65 2c 52 65 73 54 79 70 | 65 20 74 79 70 65 0d 09 |e,ResTyp|e type..|
|000008d0| 2c 69 6e 74 20 69 64 2c | 48 61 6e 64 6c 65 20 68 |,int id,|Handle h|
|000008e0| 61 6e 64 6c 65 29 3b 0d | 0d 23 69 66 20 55 4e 49 |andle);.|.#if UNI|
|000008f0| 56 45 52 53 41 4c 5f 48 | 45 41 44 45 52 53 3c 32 |VERSAL_H|EADERS<2|
|00000900| 0d 09 65 6e 75 6d 7b 64 | 52 41 4d 42 61 73 65 64 |..enum{d|RAMBased|
|00000910| 4d 61 73 6b 3d 30 78 30 | 30 34 30 7d 3b 09 2f 2a |Mask=0x0|040};./*|
|00000920| 20 64 43 74 6c 44 72 69 | 76 65 72 20 69 73 20 61 | dCtlDri|ver is a|
|00000930| 20 68 61 6e 64 6c 65 20 | 28 31 29 20 6f 72 20 70 | handle |(1) or p|
|00000940| 6f 69 6e 74 65 72 20 28 | 30 29 20 2a 2f 0d 23 65 |ointer (|0) */.#e|
|00000950| 6e 64 69 66 0d 23 69 66 | 20 50 52 41 47 4d 41 5f |ndif.#if| PRAGMA_|
|00000960| 41 4c 49 47 4e 5f 53 55 | 50 50 4f 52 54 45 44 20 |ALIGN_SU|PPORTED |
|00000970| 7c 7c 20 5f 5f 4d 57 45 | 52 4b 53 5f 5f 0d 09 23 ||| __MWE|RKS__..#|
|00000980| 70 72 61 67 6d 61 20 6f | 70 74 69 6f 6e 73 20 61 |pragma o|ptions a|
|00000990| 6c 69 67 6e 3d 6d 61 63 | 36 38 6b 0d 23 65 6e 64 |lign=mac|68k.#end|
|000009a0| 69 66 0d 0d 74 79 70 65 | 64 65 66 20 73 74 72 75 |if..type|def stru|
|000009b0| 63 74 20 7b 0d 09 73 68 | 6f 72 74 20 66 6c 61 67 |ct {..sh|ort flag|
|000009c0| 73 3b 0d 09 73 68 6f 72 | 74 20 62 6c 61 6e 6b 73 |s;..shor|t blanks|
|000009d0| 5b 33 5d 3b 0d 09 73 68 | 6f 72 74 20 6f 70 65 6e |[3];..sh|ort open|
|000009e0| 3b 0d 09 73 68 6f 72 74 | 20 70 72 69 6d 65 3b 0d |;..short| prime;.|
|000009f0| 09 73 68 6f 72 74 20 63 | 6f 6e 74 72 6f 6c 3b 0d |.short c|ontrol;.|
|00000a00| 09 73 68 6f 72 74 20 73 | 74 61 74 75 73 3b 0d 09 |.short s|tatus;..|
|00000a10| 73 68 6f 72 74 20 63 6c | 6f 73 65 3b 0d 09 53 74 |short cl|ose;..St|
|00000a20| 72 32 35 35 20 6e 61 6d | 65 3b 0d 7d 20 56 69 64 |r255 nam|e;.} Vid|
|00000a30| 65 6f 44 72 69 76 65 72 | 3b 0d 56 69 64 65 6f 44 |eoDriver|;.VideoD|
|00000a40| 72 69 76 65 72 20 2a 47 | 44 44 72 69 76 65 72 41 |river *G|DDriverA|
|00000a50| 64 64 72 65 73 73 28 47 | 44 48 61 6e 64 6c 65 20 |ddress(G|DHandle |
|00000a60| 64 65 76 69 63 65 29 3b | 0d 0d 23 69 66 20 50 52 |device);|..#if PR|
|00000a70| 41 47 4d 41 5f 41 4c 49 | 47 4e 5f 53 55 50 50 4f |AGMA_ALI|GN_SUPPO|
|00000a80| 52 54 45 44 20 7c 7c 20 | 5f 5f 4d 57 45 52 4b 53 |RTED || |__MWERKS|
|00000a90| 5f 5f 0d 09 23 70 72 61 | 67 6d 61 20 6f 70 74 69 |__..#pra|gma opti|
|00000aa0| 6f 6e 73 20 61 6c 69 67 | 6e 3d 72 65 73 65 74 0d |ons alig|n=reset.|
|00000ab0| 23 65 6e 64 69 66 0d 0d | 76 6f 69 64 20 6d 61 69 |#endif..|void mai|
|00000ac0| 6e 28 29 0d 7b 0d 09 47 | 44 48 61 6e 64 6c 65 20 |n().{..G|DHandle |
|00000ad0| 64 65 76 69 63 65 3b 0d | 09 69 6e 74 20 69 3b 0d |device;.|.int i;.|
|00000ae0| 09 0d 09 4d 61 78 69 6d | 69 7a 65 43 6f 6e 73 6f |...Maxim|izeConso|
|00000af0| 6c 65 48 65 69 67 68 74 | 28 29 3b 0d 09 70 72 69 |leHeight|();..pri|
|00000b00| 6e 74 66 28 22 57 65 6c | 63 6f 6d 65 20 74 6f 20 |ntf("Wel|come to |
|00000b10| 47 72 61 62 56 69 64 65 | 6f 44 72 69 76 65 72 2e |GrabVide|oDriver.|
|00000b20| 5c 6e 22 29 3b 0d 09 70 | 72 69 6e 74 66 28 42 72 |\n");..p|rintf(Br|
|00000b30| 65 61 6b 4c 69 6e 65 73 | 28 22 54 68 69 73 20 70 |eakLines|("This p|
|00000b40| 72 6f 67 72 61 6d 20 63 | 79 63 6c 65 73 20 74 68 |rogram c|ycles th|
|00000b50| 72 6f 75 67 68 20 61 6c | 6c 20 79 6f 75 72 20 76 |rough al|l your v|
|00000b60| 69 64 65 6f 20 64 65 76 | 69 63 65 73 20 61 6e 64 |ideo dev|ices and|
|00000b70| 20 63 6f 70 69 65 73 20 | 22 0d 09 22 65 61 63 68 | copies |".."each|
|00000b80| 20 64 72 69 76 65 72 20 | 69 6e 74 6f 20 61 20 72 | driver |into a r|
|00000b90| 65 73 6f 75 72 63 65 20 | 66 69 6c 65 2c 20 73 75 |esource |file, su|
|00000ba0| 69 74 61 62 6c 65 20 66 | 6f 72 20 73 75 62 73 65 |itable f|or subse|
|00000bb0| 71 75 65 6e 74 20 65 78 | 61 6d 69 6e 61 74 69 6f |quent ex|aminatio|
|00000bc0| 6e 20 22 0d 09 22 77 69 | 74 68 20 52 65 73 45 64 |n ".."wi|th ResEd|
|00000bd0| 69 74 20 28 77 69 74 68 | 20 74 68 65 20 43 4f 44 |it (with| the COD|
|00000be0| 45 20 65 64 69 74 6f 72 | 29 2e 20 54 68 69 73 20 |E editor|). This |
|00000bf0| 69 73 20 70 72 69 6d 61 | 72 69 6c 79 20 6f 66 20 |is prima|rily of |
|00000c00| 69 6e 74 65 72 65 73 74 | 20 74 6f 20 70 65 6f 70 |interest| to peop|
|00000c10| 6c 65 20 22 0d 09 22 77 | 68 6f 20 77 61 6e 74 20 |le ".."w|ho want |
|00000c20| 74 6f 20 65 6e 68 61 6e | 63 65 20 53 65 74 45 6e |to enhan|ce SetEn|
|00000c30| 74 72 69 65 73 51 75 69 | 63 6b 6c 79 2e 63 20 74 |triesQui|ckly.c t|
|00000c40| 6f 20 73 75 70 70 6f 72 | 74 20 6d 6f 72 65 20 76 |o suppor|t more v|
|00000c50| 69 64 65 6f 20 64 65 76 | 69 63 65 73 2e 5c 6e 22 |ideo dev|ices.\n"|
|00000c60| 2c 37 38 29 29 3b 0d 09 | 66 6f 72 28 69 3d 30 3b |,78));..|for(i=0;|
|00000c70| 69 3c 31 30 3b 69 2b 2b | 29 7b 0d 09 09 64 65 76 |i<10;i++|){...dev|
|00000c80| 69 63 65 3d 47 65 74 53 | 63 72 65 65 6e 44 65 76 |ice=GetS|creenDev|
|00000c90| 69 63 65 28 69 29 3b 0d | 09 09 69 66 28 64 65 76 |ice(i);.|..if(dev|
|00000ca0| 69 63 65 3d 3d 4e 55 4c | 4c 29 62 72 65 61 6b 3b |ice==NUL|L)break;|
|00000cb0| 0d 09 09 43 6f 70 79 44 | 65 76 69 63 65 44 72 69 |...CopyD|eviceDri|
|00000cc0| 76 65 72 28 64 65 76 69 | 63 65 29 3b 0d 09 7d 0d |ver(devi|ce);..}.|
|00000cd0| 09 70 72 69 6e 74 66 28 | 22 5c 6e 44 6f 6e 65 2e |.printf(|"\nDone.|
|00000ce0| 5c 6e 22 29 3b 0d 7d 0d | 0d 76 6f 69 64 20 43 6f |\n");.}.|.void Co|
|00000cf0| 70 79 44 65 76 69 63 65 | 44 72 69 76 65 72 28 47 |pyDevice|Driver(G|
|00000d00| 44 48 61 6e 64 6c 65 20 | 64 65 76 69 63 65 29 0d |DHandle |device).|
|00000d10| 7b 0d 09 63 68 61 72 20 | 2a 6e 61 6d 65 2c 66 69 |{..char |*name,fi|
|00000d20| 6c 65 6e 61 6d 65 5b 33 | 32 5d 3b 0d 09 6c 6f 6e |lename[3|2];..lon|
|00000d30| 67 20 64 72 69 76 65 72 | 53 69 7a 65 3b 0d 09 41 |g driver|Size;..A|
|00000d40| 75 78 44 43 45 20 2a 2a | 61 75 78 44 43 45 48 61 |uxDCE **|auxDCEHa|
|00000d50| 6e 64 6c 65 3b 0d 09 48 | 61 6e 64 6c 65 20 68 61 |ndle;..H|andle ha|
|00000d60| 6e 64 6c 65 3b 0d 09 56 | 69 64 65 6f 44 72 69 76 |ndle;..V|ideoDriv|
|00000d70| 65 72 20 2a 64 72 69 76 | 65 72 3b 0d 09 75 6e 73 |er *driv|er;..uns|
|00000d80| 69 67 6e 65 64 20 63 68 | 61 72 20 2a 62 79 74 65 |igned ch|ar *byte|
|00000d90| 50 74 72 3b 0d 09 69 6e | 74 20 76 65 72 73 69 6f |Ptr;..in|t versio|
|00000da0| 6e 3b 0d 09 0d 09 69 66 | 28 64 65 76 69 63 65 3d |n;....if|(device=|
|00000db0| 3d 4e 55 4c 4c 29 72 65 | 74 75 72 6e 3b 0d 09 70 |=NULL)re|turn;..p|
|00000dc0| 72 69 6e 74 66 28 22 5c | 6e 22 29 3b 0d 09 6e 61 |rintf("\|n");..na|
|00000dd0| 6d 65 3d 47 44 4e 61 6d | 65 53 74 72 28 64 65 76 |me=GDNam|eStr(dev|
|00000de0| 69 63 65 29 3b 0d 09 76 | 65 72 73 69 6f 6e 3d 47 |ice);..v|ersion=G|
|00000df0| 44 56 65 72 73 69 6f 6e | 28 64 65 76 69 63 65 29 |DVersion|(device)|
|00000e00| 3b 0d 09 70 72 69 6e 74 | 66 28 22 25 73 20 76 65 |;..print|f("%s ve|
|00000e10| 72 73 69 6f 6e 20 25 64 | 2e 5c 6e 22 2c 6e 61 6d |rsion %d|.\n",nam|
|00000e20| 65 2c 76 65 72 73 69 6f | 6e 29 3b 0d 09 73 74 72 |e,versio|n);..str|
|00000e30| 6e 63 70 79 28 66 69 6c | 65 6e 61 6d 65 2c 6e 61 |ncpy(fil|ename,na|
|00000e40| 6d 65 2c 33 31 29 3b 0d | 09 2f 2f 20 66 69 6c 65 |me,31);.|.// file|
|00000e50| 6e 61 6d 65 20 6d 75 73 | 74 20 62 65 20 74 72 75 |name mus|t be tru|
|00000e60| 6e 63 61 74 65 64 20 74 | 6f 20 33 31 20 63 68 61 |ncated t|o 31 cha|
|00000e70| 72 61 63 74 65 72 73 20 | 2a 2f 0d 09 66 69 6c 65 |racters |*/..file|
|00000e80| 6e 61 6d 65 5b 33 32 5d | 3d 30 3b 0d 09 2f 2f 20 |name[32]|=0;..// |
|00000e90| 52 65 70 6c 61 63 65 20 | 6c 65 61 64 69 6e 67 20 |Replace |leading |
|00000ea0| 22 2e 22 20 62 79 20 22 | 2d 22 20 73 69 6e 63 65 |"." by "|-" since|
|00000eb0| 20 74 68 65 20 4d 61 63 | 20 66 69 6c 69 6e 67 20 | the Mac| filing |
|00000ec0| 73 79 73 74 65 6d 20 0d | 09 2f 2f 20 69 73 20 63 |system .|.// is c|
|00000ed0| 6f 6e 66 75 73 65 64 20 | 62 79 20 66 69 6c 65 6e |onfused |by filen|
|00000ee0| 61 6d 65 73 20 62 65 67 | 69 6e 6e 69 6e 67 20 77 |ames beg|inning w|
|00000ef0| 69 74 68 20 22 2e 22 2e | 0d 09 69 66 28 66 69 6c |ith ".".|..if(fil|
|00000f00| 65 6e 61 6d 65 5b 30 5d | 3d 3d 27 2e 27 29 66 69 |ename[0]|=='.')fi|
|00000f10| 6c 65 6e 61 6d 65 5b 30 | 5d 3d 27 2d 27 3b 0d 0d |lename[0|]='-';..|
|00000f20| 09 64 72 69 76 65 72 3d | 47 44 44 72 69 76 65 72 |.driver=|GDDriver|
|00000f30| 41 64 64 72 65 73 73 28 | 64 65 76 69 63 65 29 3b |Address(|device);|
|00000f40| 0d 09 70 72 69 6e 74 66 | 28 22 4f 66 66 73 65 74 |..printf|("Offset|
|00000f50| 73 3a 20 6f 70 65 6e 20 | 30 78 25 78 2c 20 70 72 |s: open |0x%x, pr|
|00000f60| 69 6d 65 20 30 78 25 78 | 2c 20 63 6f 6e 74 72 6f |ime 0x%x|, contro|
|00000f70| 6c 20 30 78 25 78 2c 20 | 73 74 61 74 75 73 20 30 |l 0x%x, |status 0|
|00000f80| 78 25 78 2c 20 63 6c 6f | 73 65 20 30 78 25 78 5c |x%x, clo|se 0x%x\|
|00000f90| 6e 22 0d 09 09 2c 64 72 | 69 76 65 72 2d 3e 6f 70 |n"...,dr|iver->op|
|00000fa0| 65 6e 2c 64 72 69 76 65 | 72 2d 3e 70 72 69 6d 65 |en,drive|r->prime|
|00000fb0| 2c 64 72 69 76 65 72 2d | 3e 63 6f 6e 74 72 6f 6c |,driver-|>control|
|00000fc0| 2c 64 72 69 76 65 72 2d | 3e 73 74 61 74 75 73 2c |,driver-|>status,|
|00000fd0| 64 72 69 76 65 72 2d 3e | 63 6c 6f 73 65 29 3b 0d |driver->|close);.|
|00000fe0| 09 70 72 69 6e 74 66 28 | 22 6e 61 6d 65 20 69 73 |.printf(|"name is|
|00000ff0| 20 61 74 20 30 78 25 6c | 78 2c 20 22 2c 64 72 69 | at 0x%l|x, ",dri|
|00001000| 76 65 72 2d 3e 6e 61 6d | 65 2d 28 75 6e 73 69 67 |ver->nam|e-(unsig|
|00001010| 6e 65 64 20 63 68 61 72 | 20 2a 29 20 64 72 69 76 |ned char| *) driv|
|00001020| 65 72 29 3b 0d 09 62 79 | 74 65 50 74 72 3d 64 72 |er);..by|tePtr=dr|
|00001030| 69 76 65 72 2d 3e 6e 61 | 6d 65 3b 0d 09 62 79 74 |iver->na|me;..byt|
|00001040| 65 50 74 72 20 2b 3d 20 | 31 2b 62 79 74 65 50 74 |ePtr += |1+bytePt|
|00001050| 72 5b 30 5d 3b 09 2f 2a | 20 67 6f 20 74 6f 20 65 |r[0];./*| go to e|
|00001060| 6e 64 20 6f 66 20 50 61 | 73 63 61 6c 20 73 74 72 |nd of Pa|scal str|
|00001070| 69 6e 67 20 2a 2f 0d 09 | 62 79 74 65 50 74 72 20 |ing */..|bytePtr |
|00001080| 3d 20 28 75 6e 73 69 67 | 6e 65 64 20 63 68 61 72 |= (unsig|ned char|
|00001090| 20 2a 29 28 28 6c 6f 6e | 67 29 28 62 79 74 65 50 | *)((lon|g)(byteP|
|000010a0| 74 72 2b 31 29 20 26 20 | 7e 31 29 3b 09 2f 2f 20 |tr+1) & |~1);.// |
|000010b0| 72 6f 75 6e 64 20 75 70 | 20 74 6f 20 77 6f 72 64 |round up| to word|
|000010c0| 20 62 6f 75 6e 64 61 72 | 79 0d 09 70 72 69 6e 74 | boundar|y..print|
|000010d0| 66 28 22 76 65 72 73 69 | 6f 6e 20 69 73 20 61 74 |f("versi|on is at|
|000010e0| 20 30 78 25 6c 78 5c 6e | 22 2c 62 79 74 65 50 74 | 0x%lx\n|",bytePt|
|000010f0| 72 2d 28 75 6e 73 69 67 | 6e 65 64 20 63 68 61 72 |r-(unsig|ned char|
|00001100| 20 2a 29 20 64 72 69 76 | 65 72 29 3b 0d 0d 09 61 | *) driv|er);...a|
|00001110| 75 78 44 43 45 48 61 6e | 64 6c 65 20 3d 20 28 41 |uxDCEHan|dle = (A|
|00001120| 75 78 44 43 45 20 2a 2a | 29 20 47 65 74 44 43 74 |uxDCE **|) GetDCt|
|00001130| 6c 45 6e 74 72 79 28 28 | 2a 64 65 76 69 63 65 29 |lEntry((|*device)|
|00001140| 2d 3e 67 64 52 65 66 4e | 75 6d 29 3b 0d 09 69 66 |->gdRefN|um);..if|
|00001150| 28 28 2a 2a 61 75 78 44 | 43 45 48 61 6e 64 6c 65 |((**auxD|CEHandle|
|00001160| 29 2e 64 43 74 6c 46 6c | 61 67 73 20 26 20 64 52 |).dCtlFl|ags & dR|
|00001170| 41 4d 42 61 73 65 64 4d | 61 73 6b 29 7b 0d 09 09 |AMBasedM|ask){...|
|00001180| 70 72 69 6e 74 66 28 22 | 52 41 4d 2d 62 61 73 65 |printf("|RAM-base|
|00001190| 64 20 64 72 69 76 65 72 | 2e 5c 6e 22 29 3b 0d 09 |d driver|.\n");..|
|000011a0| 09 68 61 6e 64 6c 65 3d | 28 48 61 6e 64 6c 65 29 |.handle=|(Handle)|
|000011b0| 28 2a 2a 61 75 78 44 43 | 45 48 61 6e 64 6c 65 29 |(**auxDC|EHandle)|
|000011c0| 2e 64 43 74 6c 44 72 69 | 76 65 72 3b 0d 09 09 48 |.dCtlDri|ver;...H|
|000011d0| 61 6e 64 54 6f 48 61 6e | 64 28 26 68 61 6e 64 6c |andToHan|d(&handl|
|000011e0| 65 29 3b 0d 09 09 70 72 | 69 6e 74 66 28 22 25 6c |e);...pr|intf("%l|
|000011f0| 64 20 62 79 74 65 73 5c | 6e 22 2c 47 65 74 48 61 |d bytes\|n",GetHa|
|00001200| 6e 64 6c 65 53 69 7a 65 | 28 68 61 6e 64 6c 65 29 |ndleSize|(handle)|
|00001210| 29 3b 0d 09 7d 0d 09 65 | 6c 73 65 7b 0d 09 09 70 |);..}..e|lse{...p|
|00001220| 72 69 6e 74 66 28 22 52 | 4f 4d 2d 62 61 73 65 64 |rintf("R|OM-based|
|00001230| 20 64 72 69 76 65 72 2e | 5c 6e 22 29 3b 0d 09 09 | driver.|\n");...|
|00001240| 68 61 6e 64 6c 65 3d 47 | 65 74 44 72 69 76 65 72 |handle=G|etDriver|
|00001250| 46 72 6f 6d 53 6c 6f 74 | 4d 61 6e 61 67 65 72 28 |FromSlot|Manager(|
|00001260| 64 65 76 69 63 65 29 3b | 0d 09 09 69 66 28 68 61 |device);|...if(ha|
|00001270| 6e 64 6c 65 21 3d 4e 55 | 4c 4c 29 7b 0d 09 09 09 |ndle!=NU|LL){....|
|00001280| 70 72 69 6e 74 66 28 22 | 47 6f 74 20 64 72 69 76 |printf("|Got driv|
|00001290| 65 72 20 77 69 74 68 20 | 68 65 6c 70 20 66 72 6f |er with |help fro|
|000012a0| 6d 20 53 6c 6f 74 20 4d | 61 6e 61 67 65 72 2e 5c |m Slot M|anager.\|
|000012b0| 6e 22 29 3b 0d 09 09 09 | 70 72 69 6e 74 66 28 22 |n");....|printf("|
|000012c0| 25 6c 64 20 62 79 74 65 | 73 5c 6e 22 2c 47 65 74 |%ld byte|s\n",Get|
|000012d0| 48 61 6e 64 6c 65 53 69 | 7a 65 28 68 61 6e 64 6c |HandleSi|ze(handl|
|000012e0| 65 29 29 3b 0d 09 09 7d | 65 6c 73 65 7b 0d 09 09 |e));...}|else{...|
|000012f0| 09 2f 2f 20 57 65 20 68 | 61 76 65 20 61 20 50 74 |.// We h|ave a Pt|
|00001300| 72 20 74 6f 20 74 68 65 | 20 64 72 69 76 65 72 2c |r to the| driver,|
|00001310| 20 62 75 74 20 77 65 20 | 64 6f 6e 27 74 20 6b 6e | but we |don't kn|
|00001320| 6f 77 20 68 6f 77 20 62 | 69 67 20 69 74 20 69 73 |ow how b|ig it is|
|00001330| 2e 0d 09 09 09 64 72 69 | 76 65 72 53 69 7a 65 3d |.....dri|verSize=|
|00001340| 28 75 6e 73 69 67 6e 65 | 64 20 6c 6f 6e 67 29 20 |(unsigne|d long) |
|00001350| 47 65 74 50 74 72 53 69 | 7a 65 28 28 50 74 72 29 |GetPtrSi|ze((Ptr)|
|00001360| 28 2a 2a 61 75 78 44 43 | 45 48 61 6e 64 6c 65 29 |(**auxDC|EHandle)|
|00001370| 2e 64 43 74 6c 44 72 69 | 76 65 72 29 3b 0d 09 09 |.dCtlDri|ver);...|
|00001380| 09 69 66 28 64 72 69 76 | 65 72 53 69 7a 65 3d 3d |.if(driv|erSize==|
|00001390| 30 20 7c 7c 20 4d 65 6d | 45 72 72 6f 72 28 29 29 |0 || Mem|Error())|
|000013a0| 7b 0d 09 09 09 09 64 72 | 69 76 65 72 53 69 7a 65 |{.....dr|iverSize|
|000013b0| 3d 64 72 69 76 65 72 2d | 3e 6f 70 65 6e 3b 0d 09 |=driver-|>open;..|
|000013c0| 09 09 09 69 66 28 64 72 | 69 76 65 72 53 69 7a 65 |...if(dr|iverSize|
|000013d0| 3c 64 72 69 76 65 72 2d | 3e 70 72 69 6d 65 29 64 |<driver-|>prime)d|
|000013e0| 72 69 76 65 72 53 69 7a | 65 3d 64 72 69 76 65 72 |riverSiz|e=driver|
|000013f0| 2d 3e 70 72 69 6d 65 3b | 0d 09 09 09 09 69 66 28 |->prime;|.....if(|
|00001400| 64 72 69 76 65 72 53 69 | 7a 65 3c 64 72 69 76 65 |driverSi|ze<drive|
|00001410| 72 2d 3e 63 6f 6e 74 72 | 6f 6c 29 64 72 69 76 65 |r->contr|ol)drive|
|00001420| 72 53 69 7a 65 3d 64 72 | 69 76 65 72 2d 3e 63 6f |rSize=dr|iver->co|
|00001430| 6e 74 72 6f 6c 3b 0d 09 | 09 09 09 69 66 28 64 72 |ntrol;..|...if(dr|
|00001440| 69 76 65 72 53 69 7a 65 | 3c 64 72 69 76 65 72 2d |iverSize|<driver-|
|00001450| 3e 73 74 61 74 75 73 29 | 64 72 69 76 65 72 53 69 |>status)|driverSi|
|00001460| 7a 65 3d 64 72 69 76 65 | 72 2d 3e 73 74 61 74 75 |ze=drive|r->statu|
|00001470| 73 3b 0d 09 09 09 09 69 | 66 28 64 72 69 76 65 72 |s;.....i|f(driver|
|00001480| 53 69 7a 65 3c 64 72 69 | 76 65 72 2d 3e 63 6c 6f |Size<dri|ver->clo|
|00001490| 73 65 29 64 72 69 76 65 | 72 53 69 7a 65 3d 64 72 |se)drive|rSize=dr|
|000014a0| 69 76 65 72 2d 3e 63 6c | 6f 73 65 3b 0d 09 09 09 |iver->cl|ose;....|
|000014b0| 09 64 72 69 76 65 72 53 | 69 7a 65 2a 3d 32 3b 0d |.driverS|ize*=2;.|
|000014c0| 09 09 09 09 70 72 69 6e | 74 66 28 22 53 69 7a 65 |....prin|tf("Size|
|000014d0| 20 75 6e 6b 6e 6f 77 6e | 2c 20 67 75 65 73 73 69 | unknown|, guessi|
|000014e0| 6e 67 20 28 67 65 6e 65 | 72 6f 75 73 6c 79 29 20 |ng (gene|rously) |
|000014f0| 61 74 20 25 6c 64 2c 20 | 74 77 69 63 65 20 74 68 |at %ld, |twice th|
|00001500| 65 20 68 69 67 68 65 73 | 74 20 6f 66 66 73 65 74 |e highes|t offset|
|00001510| 2e 5c 6e 22 2c 64 72 69 | 76 65 72 53 69 7a 65 29 |.\n",dri|verSize)|
|00001520| 3b 0d 09 09 09 7d 65 6c | 73 65 20 70 72 69 6e 74 |;....}el|se print|
|00001530| 66 28 22 25 6c 64 20 62 | 79 74 65 73 5c 6e 22 2c |f("%ld b|ytes\n",|
|00001540| 64 72 69 76 65 72 53 69 | 7a 65 29 3b 0d 09 09 09 |driverSi|ze);....|
|00001550| 50 74 72 54 6f 48 61 6e | 64 28 28 2a 2a 61 75 78 |PtrToHan|d((**aux|
|00001560| 44 43 45 48 61 6e 64 6c | 65 29 2e 64 43 74 6c 44 |DCEHandl|e).dCtlD|
|00001570| 72 69 76 65 72 2c 26 68 | 61 6e 64 6c 65 2c 64 72 |river,&h|andle,dr|
|00001580| 69 76 65 72 53 69 7a 65 | 29 3b 0d 09 09 7d 0d 09 |iverSize|);...}..|
|00001590| 7d 0d 09 69 66 28 68 61 | 6e 64 6c 65 21 3d 4e 55 |}..if(ha|ndle!=NU|
|000015a0| 4c 4c 29 7b 0d 09 09 41 | 64 64 52 65 73 6f 75 72 |LL){...A|ddResour|
|000015b0| 63 65 54 6f 46 69 6c 65 | 28 63 32 70 73 74 72 28 |ceToFile|(c2pstr(|
|000015c0| 66 69 6c 65 6e 61 6d 65 | 29 2c 63 32 70 73 74 72 |filename|),c2pstr|
|000015d0| 28 6e 61 6d 65 29 2c 27 | 44 52 56 52 27 2c 76 65 |(name),'|DRVR',ve|
|000015e0| 72 73 69 6f 6e 2c 68 61 | 6e 64 6c 65 29 3b 0d 09 |rsion,ha|ndle);..|
|000015f0| 09 70 72 69 6e 74 66 28 | 22 44 72 69 76 65 72 20 |.printf(|"Driver |
|00001600| 63 6f 70 69 65 64 20 74 | 6f 20 d2 25 73 d3 20 66 |copied t|o .%s. f|
|00001610| 69 6c 65 2c 20 75 73 69 | 6e 67 20 74 68 65 20 76 |ile, usi|ng the v|
|00001620| 65 72 73 69 6f 6e 20 6e | 75 6d 62 65 72 20 25 64 |ersion n|umber %d|
|00001630| 20 61 73 20 74 68 65 20 | 72 65 73 6f 75 72 63 65 | as the |resource|
|00001640| 20 69 64 2e 5c 6e 22 0d | 09 09 09 2c 70 32 63 73 | id.\n".|...,p2cs|
|00001650| 74 72 28 28 75 6e 73 69 | 67 6e 65 64 20 63 68 61 |tr((unsi|gned cha|
|00001660| 72 20 2a 29 66 69 6c 65 | 6e 61 6d 65 29 2c 76 65 |r *)file|name),ve|
|00001670| 72 73 69 6f 6e 29 3b 0d | 09 09 44 69 73 70 6f 73 |rsion);.|..Dispos|
|00001680| 48 61 6e 64 6c 65 28 68 | 61 6e 64 6c 65 29 3b 0d |Handle(h|andle);.|
|00001690| 09 7d 65 6c 73 65 20 70 | 72 69 6e 74 66 28 22 43 |.}else p|rintf("C|
|000016a0| 6f 75 6c 64 6e 27 74 20 | 63 6f 70 79 20 64 72 69 |ouldn't |copy dri|
|000016b0| 76 65 72 2e 5c 6e 22 29 | 3b 0d 7d 0d 0d 2f 2a 0d |ver.\n")|;.}../*.|
|000016c0| 54 68 69 73 20 67 65 74 | 73 20 61 20 63 6f 70 79 |This get|s a copy|
|000016d0| 20 6f 66 20 74 68 65 20 | 64 72 69 76 65 72 20 66 | of the |driver f|
|000016e0| 72 6f 6d 20 74 68 65 20 | 73 6c 6f 74 20 6d 61 6e |rom the |slot man|
|000016f0| 61 67 65 72 2e 20 52 65 | 74 75 72 6e 73 20 4e 55 |ager. Re|turns NU|
|00001700| 4c 4c 20 75 6e 6c 65 73 | 73 20 77 65 20 63 61 6e |LL unles|s we can|
|00001710| 0d 66 69 6e 64 20 65 78 | 61 63 74 6c 79 20 74 68 |.find ex|actly th|
|00001720| 65 20 73 61 6d 65 20 64 | 72 69 76 65 72 20 61 73 |e same d|river as|
|00001730| 20 69 73 20 73 70 65 63 | 69 66 69 65 64 20 62 79 | is spec|ified by|
|00001740| 20 74 68 65 20 73 75 70 | 70 6c 69 65 64 20 47 44 | the sup|plied GD|
|00001750| 48 61 6e 64 6c 65 2e 20 | 57 65 20 63 68 65 63 6b |Handle. |We check|
|00001760| 0d 65 76 65 72 79 20 62 | 79 74 65 2e 20 54 68 69 |.every b|yte. Thi|
|00001770| 73 20 69 73 20 6e 6f 74 | 20 61 20 75 73 65 6c 65 |s is not| a usele|
|00001780| 73 73 20 6f 70 65 72 61 | 74 69 6f 6e 2c 20 62 65 |ss opera|tion, be|
|00001790| 63 61 75 73 65 20 61 6c | 74 68 6f 75 67 68 20 77 |cause al|though w|
|000017a0| 65 20 61 6c 72 65 61 64 | 79 20 68 61 76 65 0d 74 |e alread|y have.t|
|000017b0| 68 65 20 61 64 64 72 65 | 73 73 20 6f 66 20 74 68 |he addre|ss of th|
|000017c0| 65 20 64 72 69 76 65 72 | 2c 20 77 65 20 64 6f 6e |e driver|, we don|
|000017d0| 27 74 20 6e 65 63 65 73 | 73 61 72 69 6c 79 20 61 |'t neces|sarily a|
|000017e0| 6c 72 65 61 64 79 20 68 | 61 76 65 20 69 74 73 20 |lready h|ave its |
|000017f0| 73 69 7a 65 2c 20 61 6e | 64 20 74 68 65 0d 73 6c |size, an|d the.sl|
|00001800| 6f 74 20 6d 61 6e 61 67 | 65 72 20 77 69 6c 6c 20 |ot manag|er will |
|00001810| 73 75 70 70 6c 79 20 75 | 73 20 77 69 74 68 20 61 |supply u|s with a|
|00001820| 20 68 61 6e 64 6c 65 2c | 20 66 72 6f 6d 20 77 68 | handle,| from wh|
|00001830| 69 63 68 20 77 65 20 63 | 61 6e 20 6f 62 74 61 69 |ich we c|an obtai|
|00001840| 6e 20 74 68 65 20 73 69 | 7a 65 2e 0d 2a 2f 0d 48 |n the si|ze..*/.H|
|00001850| 61 6e 64 6c 65 20 47 65 | 74 44 72 69 76 65 72 46 |andle Ge|tDriverF|
|00001860| 72 6f 6d 53 6c 6f 74 4d | 61 6e 61 67 65 72 28 47 |romSlotM|anager(G|
|00001870| 44 48 61 6e 64 6c 65 20 | 64 65 76 69 63 65 29 0d |DHandle |device).|
|00001880| 7b 0d 09 53 70 42 6c 6f | 63 6b 20 73 70 42 6c 6f |{..SpBlo|ck spBlo|
|00001890| 63 6b 3b 0d 09 53 45 42 | 6c 6f 63 6b 20 73 45 42 |ck;..SEB|lock sEB|
|000018a0| 6c 6f 63 6b 3b 0d 09 75 | 6e 73 69 67 6e 65 64 20 |lock;..u|nsigned |
|000018b0| 63 68 61 72 20 2a 64 65 | 73 69 72 65 64 4e 61 6d |char *de|siredNam|
|000018c0| 65 2c 6e 61 6d 65 5b 32 | 35 36 5d 3b 0d 09 69 6e |e,name[2|56];..in|
|000018d0| 74 20 65 72 72 6f 72 3b | 0d 09 50 74 72 20 2a 68 |t error;|..Ptr *h|
|000018e0| 61 6e 64 6c 65 3b 0d 09 | 0d 09 64 65 73 69 72 65 |andle;..|..desire|
|000018f0| 64 4e 61 6d 65 3d 47 44 | 4e 61 6d 65 28 64 65 76 |dName=GD|Name(dev|
|00001900| 69 63 65 29 3b 0d 09 73 | 70 42 6c 6f 63 6b 2e 73 |ice);..s|pBlock.s|
|00001910| 70 73 45 78 65 63 50 42 | 6c 6b 20 3d 20 28 50 74 |psExecPB|lk = (Pt|
|00001920| 72 29 20 26 73 45 42 6c | 6f 63 6b 3b 0d 09 73 70 |r) &sEBl|ock;..sp|
|00001930| 42 6c 6f 63 6b 2e 73 70 | 53 6c 6f 74 20 3d 20 30 |Block.sp|Slot = 0|
|00001940| 3b 0d 09 73 70 42 6c 6f | 63 6b 2e 73 70 49 44 20 |;..spBlo|ck.spID |
|00001950| 3d 20 30 3b 0d 09 73 70 | 42 6c 6f 63 6b 2e 73 70 |= 0;..sp|Block.sp|
|00001960| 45 78 74 44 65 76 20 3d | 20 30 3b 0d 09 77 68 69 |ExtDev =| 0;..whi|
|00001970| 6c 65 28 31 29 7b 0d 09 | 09 65 72 72 6f 72 20 3d |le(1){..|.error =|
|00001980| 20 53 4e 65 78 74 53 52 | 73 72 63 28 26 73 70 42 | SNextSR|src(&spB|
|00001990| 6c 6f 63 6b 29 3b 0d 09 | 09 69 66 28 65 72 72 6f |lock);..|.if(erro|
|000019a0| 72 3d 3d 73 6d 4e 6f 4d | 6f 72 65 73 52 73 72 63 |r==smNoM|oresRsrc|
|000019b0| 73 29 20 62 72 65 61 6b | 3b 0d 09 09 69 66 28 65 |s) break|;...if(e|
|000019c0| 72 72 6f 72 29 7b 0d 09 | 09 09 70 72 69 6e 74 66 |rror){..|..printf|
|000019d0| 28 22 53 4e 65 78 74 53 | 52 73 72 63 20 65 72 72 |("SNextS|Rsrc err|
|000019e0| 6f 72 20 25 64 5c 6e 22 | 2c 65 72 72 6f 72 29 3b |or %d\n"|,error);|
|000019f0| 0d 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 7d 0d 09 |....brea|k;...}..|
|00001a00| 09 73 70 42 6c 6f 63 6b | 2e 73 70 52 65 73 75 6c |.spBlock|.spResul|
|00001a10| 74 20 3d 20 28 75 6e 73 | 69 67 6e 65 64 20 6c 6f |t = (uns|igned lo|
|00001a20| 6e 67 29 20 26 6e 61 6d | 65 3b 0d 09 09 65 72 72 |ng) &nam|e;...err|
|00001a30| 6f 72 20 3d 20 53 52 65 | 61 64 44 72 76 72 4e 61 |or = SRe|adDrvrNa|
|00001a40| 6d 65 28 26 73 70 42 6c | 6f 63 6b 29 3b 0d 09 09 |me(&spBl|ock);...|
|00001a50| 69 66 28 21 45 71 75 61 | 6c 53 74 72 69 6e 67 28 |if(!Equa|lString(|
|00001a60| 64 65 73 69 72 65 64 4e | 61 6d 65 2c 6e 61 6d 65 |desiredN|ame,name|
|00001a70| 2c 31 2c 31 29 29 63 6f | 6e 74 69 6e 75 65 3b 0d |,1,1))co|ntinue;.|
|00001a80| 09 09 65 72 72 6f 72 20 | 3d 20 53 47 65 74 44 72 |..error |= SGetDr|
|00001a90| 69 76 65 72 28 26 73 70 | 42 6c 6f 63 6b 29 3b 0d |iver(&sp|Block);.|
|00001aa0| 09 09 69 66 28 21 65 72 | 72 6f 72 29 63 6f 6e 74 |..if(!er|ror)cont|
|00001ab0| 69 6e 75 65 3b 0d 09 09 | 68 61 6e 64 6c 65 20 3d |inue;...|handle =|
|00001ac0| 20 28 48 61 6e 64 6c 65 | 29 20 73 70 42 6c 6f 63 | (Handle|) spBloc|
|00001ad0| 6b 2e 73 70 52 65 73 75 | 6c 74 3b 0d 09 09 69 66 |k.spResu|lt;...if|
|00001ae0| 28 6d 65 6d 63 6d 70 28 | 2a 68 61 6e 64 6c 65 2c |(memcmp(|*handle,|
|00001af0| 47 44 44 72 69 76 65 72 | 41 64 64 72 65 73 73 28 |GDDriver|Address(|
|00001b00| 64 65 76 69 63 65 29 2c | 47 65 74 48 61 6e 64 6c |device),|GetHandl|
|00001b10| 65 53 69 7a 65 28 68 61 | 6e 64 6c 65 29 29 21 3d |eSize(ha|ndle))!=|
|00001b20| 30 29 7b 0d 09 09 09 44 | 69 73 70 6f 73 48 61 6e |0){....D|isposHan|
|00001b30| 64 6c 65 28 68 61 6e 64 | 6c 65 29 3b 0d 09 09 09 |dle(hand|le);....|
|00001b40| 62 72 65 61 6b 3b 0d 09 | 09 7d 0d 09 09 72 65 74 |break;..|.}...ret|
|00001b50| 75 72 6e 20 68 61 6e 64 | 6c 65 3b 0d 09 7d 0d 09 |urn hand|le;..}..|
|00001b60| 72 65 74 75 72 6e 20 4e | 55 4c 4c 3b 0d 7d 00 00 |return N|ULL;.}..|
|00001b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b80| 00 00 01 00 00 00 01 b2 | 00 00 00 b2 00 00 00 66 |........|.......f|
|00001b90| 48 c0 18 00 70 00 2f 00 | 4a 04 67 04 72 67 60 0c |H...p./.|J.g.rg`.|
|00001ba0| 2f 0c 4e ba ff 5e 48 c0 | 22 00 58 8f 2f 01 2f 0c |/.N..^H.|".X././.|
|00001bb0| 12 47 72 61 62 56 69 64 | 65 6f 44 72 69 76 65 72 |.GrabVid|eoDriver|
|00001bc0| 73 2e 63 76 02 00 00 00 | 54 45 58 54 43 57 49 45 |s.cv....|TEXTCWIE|
|00001bd0| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 8c 00 00 |..TEXTCW|IE......|
|00001be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bf0| 00 00 a7 6c f9 17 00 00 | 1a ee 00 00 02 18 2f 0c |...l....|....../.|
|00001c00| 20 54 20 50 22 68 00 bc | 4e 91 2d 6e ff f4 ff ec | T P"h..|N.-n....|
|00001c10| 4e ad 00 7a 59 8f 20 54 | 2f 28 00 10 2f 2b 00 0a |N..zY. T|/(../+..|
|00001c20| 48 6e ff e8 a9 2b 28 1f | 4f ef 00 18 67 00 00 d6 |Hn...+(.|O...g...|
|00001c30| 2f 04 20 17 2d 40 ff e4 | 30 2e ff e6 b0 6e ff ee |/. .-@..|0....n..|
|00001c40| 58 8f 6f 06 3d 6e ff ee | ff e6 30 2e ff e4 b0 6e |X.o.=n..|..0....n|
|00001c50| ff ec 6f 06 3d 6e ff ec | ff e4 70 00 2f 00 2f 2e |..o.=n..|..p././.|
|00001c60| ff e4 20 17 58 8f 2f 00 | 2f 0c 2f 3c 67 72 6f 77 |.. .X./.|/./<grow|
|00001c70| 4e ad 00 fa 4f ef 00 10 | 60 00 00 8a 4a 05 66 72 |N...O...|`...J.fr|
|00001c80| 00 00 00 0a 00 00 14 0d | 00 91 00 00 00 00 00 00 |........|........|
|00001c90| 00 4c 00 03 00 00 0b 6c | 00 00 0b 7c 11 43 6f 70 |.L.....l|...|.Cop|
|00001ca0| 79 44 65 76 69 63 65 44 | 72 69 76 65 72 00 00 00 |yDeviceD|river...|
|00001cb0| 16 e3 00 00 16 fb 19 47 | 65 74 44 72 69 76 65 72 |.......G|etDriver|
|00001cc0| 46 72 6f 6d 53 6c 6f 74 | 4d 61 6e 61 67 65 72 00 |FromSlot|Manager.|
|00001cd0| 00 00 09 46 00 00 09 4a | 05 6d 61 69 6e 00 00 00 |...F...J|.main...|
|00001ce0| 00 48 00 09 4d 6f 6e 61 | 63 6f 00 00 00 00 00 00 |.H..Mona|co......|
|00001cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d00| 00 00 00 00 00 03 00 04 | 00 57 00 03 02 6c 03 3d |........|.W...l.=|
|00001d10| 00 57 00 03 02 6c 03 3d | ae 07 7a 10 00 00 05 89 |.W...l.=|..z.....|
|00001d20| 00 00 05 89 00 00 00 00 | 00 00 00 00 00 04 00 01 |........|........|
|00001d30| 00 01 00 00 01 00 00 00 | 01 b2 00 00 00 b2 00 00 |........|........|
|00001d40| 00 66 00 e9 00 5c 3a 64 | 00 00 00 1c 00 66 00 02 |.f...\:d|.....f..|
|00001d50| 42 4b 50 54 00 00 00 1a | 4d 50 53 52 00 01 00 26 |BKPT....|MPSR...&|
|00001d60| 4d 57 42 42 00 00 00 3e | 7c 61 ff ff 00 00 00 00 |MWBB...>||a......|
|00001d70| 00 00 00 00 03 ef ff ff | 00 00 00 0e 00 00 00 00 |........|........|
|00001d80| 03 ed ff ff 00 00 00 5e | 00 00 00 00 03 f0 ff ff |.......^|........|
|00001d90| 00 00 00 aa 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+